<template>
	<div id="app">
    <router-view />
	</div>
</template>

<script>
import { setTimeout } from 'timers';
export default {
  name: 'app',
  provide() {
    return {
      app: this
    }
  },
  data() {
    return {
      userInfo: { name: '', loginTime: '' }
    }
  },
  methods: {
    getUserInfo() {
      setTimeout(()=> { // 模拟异步请求
        this.userInfo = this.$local.fetch('user')
      },500)
    }
  },
  mounted() {
    this.getUserInfo()
  }
}
</script>

<style>
#app {
  height: 100%;
}
</style>
